function getStmp(){return (new Date()).getTime();}
function showInfo(msg){if(msg==''||msg==undefined){ msg='\u6570\u636E\u5DF2\u4FDD\u5B58' }	 
$.messager.show({title:'\u63D0\u793A', msg:msg, timeout:2000, showType:'slide'});//slide/show
}
function showInfoCenter(msg){if(msg==''||msg==undefined){ msg='\u6570\u636E\u5DF2\u4FDD\u5B58' }	 
	$.messager.show({
		title:'\u63D0\u793A',
		msg:msg,
		timeout:3000,showType:'slide',
		showType:'fade',
		style:{
			right:'',
			bottom:''
		}
	});
}
function showInfoTopCenter(msg){if(msg==''||msg==undefined){ msg='\u6570\u636E\u5DF2\u4FDD\u5B58' }	 
	$.messager.show({
		title:'\u63D0\u793A',
		msg:msg,
		timeout:3000,showType:'slide',
		showType:'fade',
		style:{
					right:'',
					top:document.body.scrollTop+document.documentElement.scrollTop,
					bottom:''
				}
	});
}
function openWin(_t,_u){	
	var _h=$(window).height();
	var _w=$(window).width();
	 openWin2(_t,_u,_w,_h);
}		
function openWin2(_t,_u,_w,_h){
	if(_h==0||_h==""){
		_h= $(window).height();
	}
	var tt=($(window).height()-_h)*0.5;
	var ll=($(window).width()-_w)*0.5;
	closeWindow();
	$('#innerFramWindow').window({//
		onBeforeClose:function(){blank();},shadow:true,top:tt,left:ll,
		closed:true,modal:true,collapsible:false,minimizable:false,maximizable:true,draggable:true,title:_t,width:_w,height:_h
	});
	$("#innerWinFram").attr('src',_u);
	$('#innerFramWindow').window('open');
}
function openWin3(_id,_t){	
	var _h=$(window).height();
	var _w=$(window).width();
	
	var tt=($(window).height()-_h)*0.5;
	var ll=($(window).width()-_w)*0.5;
	$('#'+_id).window({//
		onBeforeClose:function(){blank();},shadow:true,top:tt,left:ll,
		closed:true,modal:true,collapsible:false,minimizable:false,maximizable:true,draggable:true,title:_t,width:_w,height:_h
	});
	$('#'+_id).window('open');
}
function closeWindow(){$('#innerFramWindow').window('close');}
function closeParentWindow(){parent.closeWindow();}
function progressing(){
	var win = $.messager.progress({
		title:'Waiting......', msg:'Sending......'
	});
	//setTimeout(function(){
	//	$.messager.progress('close');
	//},50000)
}

function progressed(){
	$.messager.progress('close');
}
function refreshYouTab(_tab){
	var tab = $('#'+_tab).tabs('getSelected');  // get selected panel
	$('#'+_tab).tabs('update', { tab: tab,options: { } });
}
function closeWindow(){
	$('#innerFramWindow').window('close');			
}
function blank(){
	$("#innerWinFram").attr('src','');
}
function clearDataGridById(___datagrid){
	 $('#'+___datagrid).datagrid('selectAll');
	 var rows =$('#'+___datagrid).datagrid('getSelections');
		if(rows.length>0){
			for(var i= rows.length-1; i>=0; i--){
		        var index = $('#'+___datagrid).datagrid('getRowIndex', rows[i]);
		        $('#'+___datagrid).datagrid('deleteRow', index);
			}
		}
}
function ava(_v){
	if(_v.AV=='N'){
		alert("SESSION LOST!");	
		return false;
	}
	return true;
}
function isNUM(obj){
if(obj.val()=="") return;
	if (/^\d+$/.test(obj.val()))    
    {    
       return true;    
    }     
    else     
    {       
	    obj.focus();
		obj.val(""); 
       return false;    
    }
} 

function myformatter(date){
    var y = date.getFullYear();
    var m = date.getMonth()+1;
    var d = date.getDate();
    return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
}

function myparser(s){
    if (!s) return new Date();
        var ss = (s.split('-'));
        var y = parseInt(ss[0],10);
        var m = parseInt(ss[1],10);
        var d = parseInt(ss[2],10);
        if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
            return new Date(y,m-1,d);
        } else {
            return new Date();
        }
}

//ɾ���������˵Ŀո�
function trim(str){
    return str.replace(/(^\s*)|(\s*$)/g, "");
}
//ɾ����ߵĿո�
function ltrim(str){
    return str.replace(/(^\s*)/g,"");
}
//ɾ���ұߵĿո�
function rtrim(str){
    return str.replace(/(\s*$)/g,"");
}